
# 基础镜像
FROM registry.cn-shanghai.aliyuncs.com/diyu/openjdk:17-jdk-alpine

# 配置阿里云镜像源并安装工具
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
#    && apk add --no-cache \
#    wget \
#    tar \
#    bash \
#    && rm -rf /var/cache/apk/*


# 获得构建完的url
#ARG arturl
#ARG arturl = "https://packages.aliyun.com/api/protocol/678a079864cad1150f180448/generic/flow_generic_repo/files/Demo_${pipelineId}?version=${buildNumber}&userId=${executorId}&expiration=${expiration}&signature=${signature}"
#EXPOSE 8080



#MAINTAINER
#MAINTAINER coderjacky
# 创建目录
#RUN mkdir -p /home/demo

# CI_SOURCE_URL

# RUN echo  "制品url：${arturl}"

#WORKDIR /home/demo
#RUN wget -O /home/demo/artifacts.tgz ${arturl} && \
#    ls -l /home/demo/  && \
#    tar -xvf /home/demo/artifacts.tgz && \
#    rm -fr /home/demo/artifacts.tgz


#RUN wget --user=ccy2008@163.com --password=ccy251314 -O /home/demo/artifacts.tgz https://packages.aliyun.com/generic/flow_generic_repo/artifacts?artifactName=Demo_4196094&version=SNAPSHOT && \
#    tar -xvf /home/demo/artifacts.tgz && \
#    rm -fr /home/demo/artifacts.tgz

#--build-arg arturl=https://packages.aliyun.com/generic/flow_generic_repo/artifacts?artifactName=Demo_4196094&version=SNAPSHOT

# ENTRYPOINT ["java","-jar","-Xms376M -Xmx376M","*.jar", "--spring.profiles.active=prod"]
#ENTRYPOINT java -jar *.jar --spring.profiles.active=prod
# ENTRYPOINT java -jar *.jar

# author
MAINTAINER coderjacky

# 挂载目录
VOLUME /home/coderjacky
# 创建目录
RUN mkdir -p /home/coderjacky
# 指定路径
WORKDIR /home/coderjacky
# 复制jar文件到路径
COPY ./jar/*.jar /home/coderjacky/*.jar
# 启动系统服务
ENTRYPOINT ["java","-jar","*.jar"]


